<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<include file="public:meta" />
	<link href="../public/css/members/common.css" rel="stylesheet" type="text/css" />
	<link href="../public/css/personal/personal_ajax_dialog.css" rel="stylesheet" type="text/css" />	
</head>
<body>
	<include file="header" />
	<div class="reg_per">
		<div class="rl J_focus">
			<div class="switch_title"><a class="mycolor" href="{:U('members/register',array('utype'=>1))}">切换为企业注册>></a></div>
			<div class="regtab">
				<if condition="C('qscms_sms_open') eq 1">
				<div class="tabli t1 select"><div class="v">手机注册</div></div>
				<else />
				<div class="tabli t2 select"><div class="v mycolor">邮箱注册</div></div>
				</if>
				<if condition="C('qscms_weixin_apiopen') and C('qscms_weixin_scan_reg')">
					<div id="J_weixinReg" class="tabli t3"><div class="v">微信注册</div></div>
				</if>
				<div class="clear"></div>
			</div>
			<div class="clear"></div>
			<if condition="C('qscms_sms_open') eq 1">
			<!-- 手机注册-->
			<div class="tabshow" style="display:block">
				<form class="J_passwordalert_group" id="regMobileForm" action="{:U('members/register')}" method="post" onkeydown="if(event.keyCode==13){return false;}">
					<input type="hidden" name="incode" value="{$Think.get.incode}">
					<div class="J_validate_group">
						<div class="td1">
							<input class="input_295_34" name="mobile" id="mobile" type="text" placeholder="请输入手机号码" autocomplete="off" />
						</div>
						<div class="td2 J_showtip_box"></div>
						<div class="clear"></div>
					</div>
					<div class="J_validate_group">
						<div class="td1">
							<div class="code">
								<input class="input_295_34" name="mobile_vcode" id="mobile_vcode" type="text" placeholder="请输入短信验证码" autocomplete="off" />
							</div>
							<div class="codebtn">
								<input type="button" class="btn_yellow J_hoverbut" id="J_getverificode" value="获取验证码" />
								<div id="popup-captcha"></div>
								<input type="hidden" id="btnCheck" />
							</div>
							<div class="clear"></div>
						</div>
						<div class="td2 J_showtip_box"></div>
						<div class="clear"></div>
					</div>
					<div class="J_validate_group">
						<div class="td1">
							<input class="input_295_34 J_passwordalert" name="password" id="password" type="password" placeholder="请输入账户密码" autocomplete="off" />
						</div>
						<div class="td2 J_showtip_box"></div>
						<div class="clear"></div>
					</div>
					<div class="safety">
						<div class="slist t1">危险</div>
						<div class="slist t2">一般</div>
						<div class="slist t3">安全</div>
						<div class="clear"></div>
					</div>
					<div class="J_validate_group">
						<div class="td1">
							<input name="passwordVerify" type="password"  class="input_295_34" placeholder="请确认账户密码" autocomplete="off" />
						</div>
						<div class="td2 J_showtip_box"></div>
						<div class="clear"></div>
					</div>
					<div class="agreement link_blue"><label><input class="J_agreement_per" name="agreement" type="checkbox" value="1" checked="checked" />
					我已阅读并同意<a href="javascript:;" class="J_reg_agreement">《{:C('qscms_site_name')}用户服务协议》</a></label></div>
					<input type="hidden" name="reg_type" value="1" />
					<input type="hidden" name="utype" value="2">
					<div class="btnbox"><input id="btnMoilbPhoneRegister" type="submit" value="注册" class="btn_reg J_hoverbut" /></div>
					<div id="popup-captcha-mobile"></div>
					<input type="hidden" id="btnCheckMobile" />
				</form>
			</div>
			</if>
			<!-- 邮箱注册-->
			<if condition="C('qscms_sms_open') eq 1">
			<div class="tabshow">
			<else />
			<div class="tabshow" style="display:block">
			</if>
				<form class="J_passwordalert_group" id="regEmailForm" action="{:U('members/register')}" method="post" onkeydown="if(event.keyCode==13){return false;}">
					<input type="hidden" name="incode" value="{$Think.get.incode}">
					<div class="J_validate_group">
						<div class="td1">
							<input class="input_295_34" name="username" id="username" type="text" placeholder="请输入用户名" autocomplete="off" />
						</div>
						<div class="td2 J_showtip_box"></div>
						<div class="clear"></div>
					</div>
					<div class="J_validate_group">
						<div class="td1">
							<div class="reg-form-content">
								<input class="input_295_34 inputElem" name="email" id="email" type="text" placeholder="请输入常用邮箱" autocomplete="off" />
							</div>
						</div>
						<div class="td2 J_showtip_box"></div>
						<div class="clear"></div>
					</div>
					<div class="J_validate_group">
						<div class="td1">
							<input class="input_295_34 J_passwordalert" name="emailpassword" id="emailpassword" type="password" placeholder="请输入账户密码" autocomplete="off" />
						</div>
						<div class="td2 J_showtip_box"></div>
						<div class="clear"></div>
					</div>
					<div class="safety">
						<div class="slist t1">危险</div>
						<div class="slist t2">一般</div>
						<div class="slist t3">安全</div>
						<div class="clear"></div>
					</div>
					<div class="J_validate_group">
						<div class="td1">
							<input class="input_295_34" name="emailpasswordVerify" id="emailpasswordVerify" type="password" placeholder="请确认账户密码" autocomplete="off" />
						</div>
						<div class="td2 J_showtip_box"></div>
						<div class="clear"></div>
					</div>
					<div class="agreement link_blue"><label><input class="J_agreement_per" name="agreement" type="checkbox" value="" checked="checked" />
					我已阅读并同意<a href="javascript:;" class="J_reg_agreement">《{:C('qscms_site_name')}用户服务协议》</a></label></div>
					<input type="hidden" name="reg_type" value="2" />
					<input type="hidden" name="utype" value="2">
					<div class="btnbox"><input id="btnEmailRegister" type="submit" value="注册" class="btn_reg J_hoverbut" /></div>
					<div id="popup-captcha-email"></div>
					<input type="hidden" id="btnCheckEmail" />
				</form>	
			</div>
			<!-- 微信注册-->
			<if condition="C('qscms_weixin_apiopen') and C('qscms_weixin_scan_reg')">
				<div class="tabshow weixin">
					<div class="weixin_tit">微信扫码，安全注册</div>
					<div id="J_regQrcodeWrap" class="weixin_code"></div>
					<div class="weixin_txt">打开 手机微信 <br /> 扫一扫完成注册</div>
				</div>
			</if>
		</div>
		
		<div class="clear"></div>
	</div>
	<input type="hidden" id="J_captcha_open" value="<if condition="C('qscms_captcha_open') eq 1 && C('qscms_captcha_config.varify_mobile') eq 1">1<else/>0</if>" />
	<input type="hidden" id="J_config_varify_reg" value="{:C('qscms_captcha_config.varify_reg')}" />
	<!--下方阴影 -->
	<div class="margin-width"></div>
	<qscms:text 列表名="agreement" 类型="agreement" />
	<include file="public:footer_min" />
	<script type="text/javascript" src="../public/js/jquery.form.js"></script>
	<script type="text/javascript" src="../public/js/jquery.validate.js"></script>
	<script type="text/javascript" src="../public/js/members/jquery.pwdalert.js"></script>
	<script type="text/javascript" src="../public/js/members/jquery.validate.regpersonal.js"></script>
	<script type="text/javascript" src="../public/js/jquery.modal.dialog.js"></script>
	<script type="text/javascript" src="../public/js/emailAutoComplete.js"></script>
	<script src="http://static.geetest.com/static/tools/gt.js"></script>
	<script src="../public/js/members/jquery.common.js" type="text/javascript" language="javascript"></script>
	<script type="text/javascript">
	  	// 默认第一项获得焦点
		$('#mobile').focus().addClass('input_focus');

		//注册协议弹框
	  	$(".J_reg_agreement").click(function(){
			var qsDialog = $(this).dialog({
        		title: "{:C('qscms_site_name')}注册协议",
				backdrop: false
			});
			$.getJSON("{:U('Home/Members/agreement')}",function(result){
				if(result.status==1){
					qsDialog.setContent(result.data);
				}
			});
		});

		<if condition="C('qscms_weixin_apiopen') and C('qscms_weixin_scan_login')">
			get_weixin_qrcode();
		</if>

		var qrcode_reg_time,
			waiting_weixin_reg = function(){
				$.getJSON("{:U('Members/waiting_weixin_reg')}",function(result){
					if(result.status == 1){
						window.location.href = result.data;
					}
				});
			},
			get_weixin_reg_qrcode = function(){
				clearInterval(qrcode_reg_time);
				$.getJSON("{:U('Qrcode/get_weixin_qrcode')}",{type:'reg'},function(result){
					if(result.status == 1){
						$('#J_regQrcodeWrap').empty().append(result.data);
						qrcode_time=setInterval(waiting_weixin_reg,5000);
					}else{
						$('#J_regQrcodeWrap').empty().html(result.msg);
					}
				});
			};
		$('#J_weixinReg').click(function(){
			get_weixin_reg_qrcode();
		});

		// 是否同意注册协议
		$('.J_agreement_per').die().live('click', function() {
			if ($(this).is(':checked')) {
				$(this).closest('.tabshow').find('.btn_reg').prop('disabled', 0).removeClass('btn_disabled');
			} else {
				$(this).closest('.tabshow').find('.btn_reg').prop('disabled', !0).addClass('btn_disabled');
			}
		})
	</script>
</body>
</html>